<template>
  <div>
    <ul>
      <li v-for="i in order">订单号：{{ i.order_no }}------金额：{{ i.money }}
        <ul>
          <li v-if="i.status==1">未支付

          </li>
          <li v-else>
            <button @click="fahuo(i.shopid)">发货</button>
          </li>
        </ul>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "show_order",
  data() {
    return {
      order: [],
      userid: localStorage.getItem('userid')
    }
  },
  methods: {
    get_order() {
      this.$axios.get('/login/dsuser')
        .then(res => {
          if (res.data.code == 200) {
            this.order = res.data.list
          }

        })
    },
    fahuo(id) {
      this.$axios.post('/login/fahuo', {'id': id, 'userid': this.userid})
        .then(res => {
          if (res.data.code == 200) {
            window.location.href = res.data.url
          }
        })

    }


  },
  mounted() {
    this.get_order()
  }
}
</script>

<style scoped>

</style>
